"use strict";

const BaseModel = require("../basics/mysql/mapper");
class HomeModel extends BaseModel {
  constructor(cloud) {
    super(cloud, "goods");
  }

  /**
   * 获取实例
   * @param {*} cloud 
   */
  static getInstant(cloud) {
    return new HomeModel(cloud);
  }



  /**
   * 查询列表
   */
  async selectList(type) {
    const ex = this.createExample();
    ex.criteria.andEqual("type", type);
    ex.setOrder("sort", "asc");
    ex.setColumns(["id", "itemId", "name", "imgurl", "original", "discount"]);
    return await this.selectListByExample(ex);
  }

}

module.exports = HomeModel;